package com.crm.jdy.service.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.jdy.common.dto.PeoductInfoDto;
import com.crm.jdy.common.mapper.ClientSourceInfoMapper;
import com.crm.jdy.common.pojo.ClientChargeInfo;
import com.crm.jdy.common.pojo.PeoductInfo;
import com.crm.jdy.common.mapper.PeoductInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**   
 * @Description:(公司产品信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class PeoductInfoServiceImpl  extends ServiceImpl<PeoductInfoMapper,PeoductInfo> implements PeoductInfoService  {

    @Autowired
    PeoductInfoMapper peoductInfoMapper;

    @Override
    public PageInfo<PeoductInfo> seletePeoductInfo(PeoductInfoDto callAplanInfoDto) {
          PageHelper.startPage( callAplanInfoDto.getCurrentPage(),callAplanInfoDto.getPageSize());
          List<PeoductInfo> bookList = peoductInfoMapper.seletePeoductInfo(callAplanInfoDto);
          PageInfo<PeoductInfo> pageInfo = new PageInfo<PeoductInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updatePeoductInfo(PeoductInfo callAplanInfoDto) {
        return peoductInfoMapper.updateById(callAplanInfoDto) > 0;
    }

    @Override
    public boolean addPeoductInfo(PeoductInfo callAplanInfo) {
        return peoductInfoMapper.insert(callAplanInfo) > 0;
    }

    @Override
    public boolean removePeoductInfo(String aplanId) {
        return peoductInfoMapper.deleteById(aplanId) > 0;
    }



}